package com.risk.kernel.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author: Liwen
 * @createTime: 2025/1/24
 * @description:
 */
public class ExceptionUtil {
    public static String handleExceptionFormat(Exception e) {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw, true));
//        String info = sw.toString().replaceAll("\r", "").replaceAll("\t", "").replaceAll("\n", "").replaceAll("tat", "");
//        String info = sw.toString().replaceAll("tat", "");
        String sa = sw.toString();
        return sa.substring(0, sa.indexOf("\n"));
    }
}
